package entity;

import lombok.*;

@ToString//自动获得toString方法
@Setter//自动获得所有字段的setter方法
@Getter//自动获得所有字段的getter方法
@AllArgsConstructor//自动获得全参构造器
@NoArgsConstructor//自动获得无参构造器
public class Teacher {
    private Long id;
    private String name;

    private Department department;

    public Teacher(Long id,String name, Department department) {
        this.name = name;
        this.id=id;
        this.department = department;
    }

    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Department getDepartment() {
        return department;
    }
    public void setDepartment(Department department) {
        this.department = department;
    }


    @Override
    public String toString() {
        return "Teacher{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", department=" + (department != null ? department.toString() : "null") +
                '}';
    }


}
